<?php
/**
 * Class descript.
 * User: chan
 * Date: 2017/9/28 19:24
 */

namespace app\api\controller;


use app\api\logic\Order as OrderService;


class Order extends Base
{

    //检查权限作用域
    protected $beforeActionList  = [
        'checkPrimaryScope' => [
            'except' => ''
        ],
    ];

    /**
     * @return \think\response\Json
     */
    public function placeOrder()
    {
        $order = new OrderService;
        $result = $order->place();
        return $this->ajaxReturn($result);
    }

    /**
     * 预订单
     */
    public function preOrder(){
        return $this->ajaxReturn(
            (new OrderService())->preOrder()
        );
    }

    /**
     * 订单列表
     */
    public function index(){
        return $this->ajaxReturn(
            (new OrderService())->index()
        );
    }

    /**
     * 订单详情
     */
    public function detail(){
        return $this->ajaxReturn(
            (new OrderService())->detail()
        );
    }

    /**
     * 取消订单
     */
    public function cancel(){
        return $this->ajaxReturn(
            (new OrderService())->cancel()
        );
    }



    /**
     * 评论
     */
    public function comment(){
        return $this->ajaxReturn(
            (new OrderService())->comment()
        );
    }

    /**
     * 评论
     */
    public function commentbefore(){
        return $this->ajaxReturn(
            (new OrderService())->commentbefore()
        );
    }


    /**
     * 确认收货
     */
    public function receive(){
        return $this->ajaxReturn(
            (new OrderService())->receive()
        );
    }


    /**
     * 退款
     */
    public function refund()
    {
        return $this->ajaxReturn(
            (new OrderService())->refund()
        );
    }


    /**
     * 删除订单
     */
    public function delOrder(){
        return $this->ajaxReturn(
            (new OrderService())->delOrder()
        );
    }


    /**
     * 买单
     */
    public function pay()
    {
        return $this->ajaxReturn(
            (new OrderService())->pay()
        );
    }



}






















